package com.cloud.entity;

import com.alibaba.fastjson.JSONObject;
import com.cloud.util.constants.Constants;

/**
 * @author Henry.Song
 * @version 2020/11/26
 * @description
 */
public class ResultEntity extends JSONObject {
    public Integer getCode() {
        return getInteger("code");
    }

    public void setCode(Integer code) {
        put("code", code);
    }

    public boolean isSuccess() {
        return Constants.SUCCESS_CODE == getCode();
    }

    public String getMsg() {
        return getString("msg");
    }

    public void setMsg(String msg) {
        put("msg", msg);
    }

    public Object getInfo() {
        return get("info");
    }

    public void setInfo(Object info) {
        put("info", info);
    }
}
